package com.highcom;

import com.highcom.domain.Account;
import com.highcom.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        AccountService accountService = (AccountService) ctx.getBean("accountService");

        /*List<Account> accounts = accountService.findAll();
        System.out.println("accounts = " + accounts);

        Account byId = accountService.findById(1);
        System.out.println(byId);*/

        //accountService.delete(1);

        Account account = new Account();
        account.setName("wula1");
        account.setMoney(5001.0);
        account.setId(12);
        //accountService.save(account);
        accountService.update(account);
    }
}